package com.example.book.config.tomcat;

import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wb-ys274743
 * @Date 2018/9/3
 * @see org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration
 * @see <a href="http://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Common_Attributes">apach connector doc</a>
 */
@Configuration
public class TomcatConfigration {


    @Bean
    public ServletWebServerFactory servletContainer() {
        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
        tomcat.setProtocol("org.apache.coyote.http11.Http11Nio2Protocol");
        return tomcat;
    }
}
